/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kmcsoft.goldshop.model.master;

import com.kmcsoft.emaster.entity.Employee;
import com.kmcsoft.emaster.entity.TrackableEntity;
import java.util.HashSet;
import java.util.Set;
import javax.jdo.annotations.FetchGroup;
import javax.jdo.annotations.FetchGroups;
import javax.jdo.annotations.Order;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

/**
 *
 * @author kmcsoft02
 */
@PersistenceCapable(detachable = "true", table = "shop_booth")
@FetchGroups(value = {
    @FetchGroup(name = "detach_Booth_All", members = {
        @Persistent(name = "employees"),
        @Persistent(name = "productGolds"),
        @Persistent(name = "jewelryStyles")}),
    @FetchGroup(name = "detach_Booth_JewelryStyle", members = {
        @Persistent(name = "jewelryStyles")}),
    @FetchGroup(name = "detach_Booth_Employee", members = {
        @Persistent(name = "employees")}),
    @FetchGroup(name = "detach_Booth_ProductGold", members = {
        @Persistent(name = "productGolds")})
})
public class Booth extends TrackableEntity {

    @Persistent
    private String code;
    @Persistent
    private String name;
    @Persistent
    private String note;
    @Persistent
    private Set<JewelryStyle> jewelryStyles;
    @Persistent
    private Set<ProductGold> productGolds;
    @Persistent
    @Order(column = "Booth_Employee_OWN")
    private Set<Employee> employees;

    public Booth() {
        code= new String();
        name= new String();
        jewelryStyles = new HashSet<JewelryStyle>();
        productGolds = new HashSet<ProductGold>();
        employees = new HashSet<Employee>();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Set<JewelryStyle> getJewelryStyles() {
        return jewelryStyles;
    }

    public void setJewelryStyles(Set<JewelryStyle> jewelryStyles) {
        this.jewelryStyles = jewelryStyles;
    }

    public Set<ProductGold> getProductGolds() {
        return productGolds;
    }

    public void setProductGolds(Set<ProductGold> productGolds) {
        this.productGolds = productGolds;
    }


    public Set<Employee> getEmployees() {
        return employees;
    }

    public void setEmployees(Set<Employee> employees) {
        this.employees = employees;
    }

    public int getNumberofEmployees() {
        return employees.size();
    }
}
